<html>
<head>
<title>管理系统</title>
<meta http-equiv=Content-Type content=text/html;charset=utf-8>
<#include "../inc/commonJs.html">
<script language="JavaScript">
	var grid;
	$(function() {
		//分类管理表格  
		grid = $('#customgrid').datagrid({
        url:'listCustomLog.do',  
        loadMsg:'数据加载中请稍后……',  
        striped: true,  
        singleSelect : true,  
        pagination: true,  
        rownumbers: true, 
        pageSize: [${syscfg.pageSize!10}],
        pageList: [${syscfg.pageList!10}],
        columns:[[  
             {field:'title',title: '日志标题',align: 'center',width: '100'},  
             {field:'userfullname',title: '用户',align: 'center',width: '100'},  
             {field:'content',title: '日志内容',align: 'center',width: '400'},
             {field:'dt',title: '创建日期',align: 'center',width: '150'},
        ]],
        toolbar : '#toolbar'
     });
  });
  //新增
	function doAdd() {
		var url = '${request.contextPath}/xadmin/custom/customLogWindow.do';
		top.modalwindow(url, grid, { width:550,height:350,title:'新增客户信息'});
	}
	//工具栏修改
	function doEdit() {
		var selected = grid.datagrid('getSelected');
		if(!selected){
			$.messager.alert('提示',"请选择相关数据进行操作！");
			return;
		}
		var url = '${request.contextPath}/xadmin/custom/customLogWindow.do?id='+selected.id;
		top.modalwindow(url, grid,{width:550,height:350,title:'修改客户信息'});
	}
	//工具栏删除
	function doDel(){
		var selected =  grid.datagrid('getSelected');
		if(!selected){
			$.messager.alert('提示',"请选择相关数据进行操作！");
			return;
		}
		$.messager.confirm('系统提示', '<br>&nbsp;&nbsp;&nbsp;&nbsp;你确定要删除该信息?', function(r) {
			if (r) {
				$.post("delCustomLog.do", { "id": selected.id},
				   function(data){
				   	 grid.datagrid('reload'); 
				   	 top.messagershow(data);
				});
			}
		});
	}
	//
	function addLog(id){
		var url = '${request.contextPath}/xadmin/custom/customLogWindow.do?customid='+id;
		top.modalwindow(url, grid,{width:550, height:300,title:'添加拜访客户日志'});
	}
	//
	function logView(id){
	
	}
	//刷新
	function doReload(){
		$('#toolbar input').val('');
		grid.datagrid('reload',{});
	}
	//搜索
	function doSearch(){
		var params = {};
		if($('#title').val()){
			params['title'] = $('#title').val();
		}
		grid.datagrid('reload',params);
	}
</script>
</head>
<body>
<table id="customgrid" data-options="fit:true,border:false"></table>
<div id="toolbar" style="display: none;">
<table border="0" cellpadding="0" cellspacing="0">
	<tr>
	<td valign="center">
	<td valign="center"><div class="datagrid-btn-separator"></div></td>
	</td>
	<td valign="center">
	&nbsp;用户名：<input class="easyui-validatebox" type="text" id="title" name="title" maxlength="30" style="width:150px;">
	</td>
	<td valign="center">	
	<a href="javascript:doSearch();" class="easyui-linkbutton" data-options="iconCls:'icon-search',plain:true">搜索</a>
	</td>
	<td valign="center">
	<a href="javascript:doReload();" class="easyui-linkbutton" data-options="iconCls:'icon-reload',plain:true">刷新</a>
	</td>
	<td valign="center"><div class="datagrid-btn-separator"></div></td>
	<td valign="center" align="left">
	<a href="javascript:doAdd();" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true">增加</a>
	</td>
	<td valign="center" align="left">
	<a href="javascript:doEdit();" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true">修改</a>
	</td>
	<td valign="center" align="left">
	<a href="javascript:doDel();" class="easyui-linkbutton" data-options="iconCls:'icon-cancel',plain:true">删除</a>
	</td>
	<td valign="center"><div class="datagrid-btn-separator"></div></td>
</tr>
</table>
</div>	
</body>
</html>